# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Sébastien Luttringer

pkgname=perl-file-rsyncp
pkgver=0.76
pkgrel=4
pkgdesc='Perl interface to rsync file list encoding and decoding'
arch=('loong64' 'x86_64')
license=('GPL' 'PerlArtistic')
depends=('perl')
options=('!emptydirs' '!makeflags')
url='https://search.cpan.org/dist/File-RsyncP'
source=("https://search.cpan.org/CPAN/authors/id/C/CB/CBARRATT/File-RsyncP-$pkgver.tar.gz"
        gcc12.patch)
sha512sums=('b81d9ce63181605939e8aff87c9e56ab276899f019f44eb3f149e7ee0d44a94fcbee771381ebe6ca8281c2de0d57d9cbdbcb972ccb7406a0aefd920040603bb3'
            'b85bce8160f48b6325aec25df71c8ca7b48bc182327e4b9089d5e8ba65de9117e6da2517cf3184f1a65f61e77c73b9457ea47fa6926814b78b3201163c54c375')

prepare() {
  cd File-RsyncP-$pkgver
  # https://rt.cpan.org/Public/Bug/Display.html?id=141822
  patch -Np1 -i ../gcc12.patch
}

build() {
  cd File-RsyncP-$pkgver
  USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd File-RsyncP-$pkgver
  make test
}

package() {
  cd File-RsyncP-$pkgver
  make install DESTDIR="$pkgdir/"
}

# vim:set ts=2 sw=2 et:
